package com.mycinema.entity;

import java.util.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

//import com.fasterxml.jackson.annotation.JsonFormat;


public class Movie {

	private int id;
	@NotBlank(message="标题不能为空")
	@Length(max=8,min=2,message="长度必须2-8之间")
	private String title;
	@NotBlank(message="电影编码不能为空")
	private String movieCode;
	private String director;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getMovieCode() {
		return movieCode;
	}
	public void setMovieCode(String movieCode) {
		this.movieCode = movieCode;
	}
	public String getDirector() {
		return director;
	}
	public void setDirector(String director) {
		this.director = director;
	}
	public Date getDateReleased() {
		return dateReleased;
	}
	public void setDateReleased(Date dateReleased) {
		this.dateReleased = dateReleased;
	}
	public Category getCategory() {
		return category;
	}
	public void setCategory(Category category) {
		this.category = category;
	}

	@NotNull(message="上映日期不能为空")
	//@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
	private Date dateReleased;
	//多对一关系
	private Category category;
}
